
class NoteInfo{

  static const String NAME = 'note';
  static const String CREATE = 'CREATE TABLE IF NOT EXISTS $NAME(id INTEGER PRIMARY KEY AUTOINCREMENT,createTime Long, commitTime Long,targetTime Long, title TEXT,content TEXT, tags TEXT,action INT,userId TEXT)';

  int id;
  int createTime;
  int commitTime;
  int targetTime;
  String title;
  String content;
  String tags;
  int action;
  String userId;
  //与服务器同步状态?=>单独用一个表?

  NoteInfo({
    this.id,
    this.createTime,
    this.commitTime,
    this.targetTime,
    this.title,
    this.content,
    this.tags,
    this.action,
    this.userId,
  });

  NoteInfo.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    createTime = json['createTime'];
    commitTime = json['commitTime'];
    targetTime = json['targetTime'];
    title = json['title'];
    content = json['content'];
    tags = json['tags'];
    action = json['action'];
    userId = json['userId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['createTime'] = this.createTime;
    data['commitTime'] = this.commitTime;
    data['targetTime'] = this.targetTime;
    data['title'] = this.title;
    data['content'] = this.content;
    data['tags'] = this.tags;
    data['action'] = this.action;
    data['userId'] = this.userId;
    return data;
  }



}